<!DOCTYPE html>
<html lang="en">
<head>
	<title></title>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap.min.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap-responsive.min.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/uniform.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/select2.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-style2.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-media.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/font-awesome/css/font-awesome.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/changyun.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/kindeditor/themes/default/default.css"/>
	<style>
		body {
			font-size: 14px;
		}

		.form-horizontal label {
			display: inline-block;
		}

		.info_table td {
			text-align: left;
		}

		.form-horizontal .control-label {
			padding-top: 15px;
			width: 120px;
		}

		.form-horizontal .controls {
			margin-left: 130px;
			padding: 10px 0;
		}

		ul, li {
			list-style: none;
		}

		.upload_img_list {
			width: 100%;
			display: block;
		}

		.upload_img_list li {
			float: left;
			margin-right: 5px;
			margin-bottom: 10px;
		}

		.upload_img_list li img {
			width: 80px;
			height: 80px;
			border: 1px solid #cccccc;
			padding: 1px;
		}

		.tab_on_select {
			background: #5bb75b;
		}

		.tab_on_select a {
			color: #ffffff;
		}

		.upload_img_list_350_476 {
			width: 100%;
			display: block;
		}

		.upload_img_list_350_476 li {
			float: left;
			margin-right: 5px;
			margin-bottom: 10px;
		}

		.upload_img_list_350_476 li img {
			width: 350px;
			height: 476px;
			border: 1px solid #cccccc;
			padding: 1px;
		}
	</style>
</head>
<body style="background: #ffffff;">
<div class="container-fluid" style="padding:0px;">
	<div class="widget-content tab-content">
		<div id="tab1" class="tab-pane active">
			<div class="widget-content nopadding">
				<form action="{#$this_url_action}" method="post" class="form-horizontal" id="form_basic_validate">
					<if condition="$agent_level gt 1 And $agent_level neq 5">
						<div class="control-group">
							<label class="control-label">所属招商经理 :</label>
							<div class="controls">
								<select name="pid1" style="width:400px;" id="zs_manage_id">
									<option value="0">==选择招商经理==</option>
									<volist name="zs_manage_list" id="data">
										<option value="{#$data.id}"
										<if condition="$info.agent_pid == $data[id]">selected</if>
										>{#$data.agent_name}【{#$data.agent_phone}】</option>
									</volist>
								</select>

							</div>
						</div>
					</if>
					<if condition="$agent_level gt 2 And $agent_level neq 5">
						<div class="control-group">
							<label class="control-label">所属代理商 :</label>
							<div class="controls">
								<select name="pid2" style="width:400px;" id="agent_id">
									<option value="0">==选择代理商==</option>
									<volist name="agent_list" id="data">
										<option value="{#$data.id}"
										<if condition="$info.agent_pid == $data[id]">selected</if>
										>{#$data.agent_name}【{#$data.agent_phone}】</option>
									</volist>
								</select>
							</div>
						</div>
					</if>
					<div class="control-group">
						<label class="control-label">{#$agent_level_name}名 :</label>
						<div class="controls">
							<input type="text" class="span6" id="agent_name" name="agent_name" value="{#$info.agent_name}"/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">手机号码 :</label>
						<div class="controls">
							<input type="text" class="span6" id="agent_phone" name="agent_phone" value="{#$info.agent_phone}"/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">登陆密码 :</label>
						<div class="controls">
							<input type="password" class="span6" id="agent_login_pass" name="agent_login_pass" value=""/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">所属城市 :</label>
						<div class="controls" id="city_4">
							<select name="agent_province" class="prov" style="width: 180px;"></select>
							<select name="agent_city" class="city" disabled="disabled" style="width: 180px;"></select>
							<select name="agent_district" class="dist" disabled="disabled" style="width: 180px;"></select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">状态 :</label>
						<div class="controls" style="padding:15px 0 0 0;">
							<label><input type="radio" name="agent_status" value="1"
								<eq name="info.agent_status" value="1">checked</eq>
								/>启用</label>
							<label style="margin-left: 10px;"><input type="radio" name="agent_status" value="0"
								<eq name="info.agent_status" value="0">checked</eq>
								/>禁用</label>
						</div>
					</div>
					<div style="position: fixed;bottom:10px;right:10px;">
						<input type="hidden" name="agent_level" value="{#$agent_level|default=0}">
						<input type="hidden" name="id" value="{#$info.id|default=''}">
						<button type="button" class="btn layer-open-cancel">取消</button>
						<button type="submit" class="btn btn-success">提交</button>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script src="__PUBLIC__/Admin/js/jquery.min.js"></script>
<script src="__PUBLIC__/Admin/js/jquery.ui.custom.js"></script>
<script src="__PUBLIC__/Admin/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/Admin/js/jquery.uniform.js"></script>
<script src="__PUBLIC__/Admin/js/matrix.js"></script>
<script src="__PUBLIC__/Admin/js/matrix.tables.js"></script>
<script src="__PUBLIC__/Admin/js/select2.min.js"></script>
<script src="__PUBLIC__/Admin/js/common.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/Validform.min.js"></script>

<script>
var city_js_root = "__PUBLIC__/js/citySelect/";
</script>
<script type="text/javascript" src="__PUBLIC__/js/citySelect/jquery.cityselect.js"></script>
<script>
$("#city_4").citySelect({
	prov: "{#$info.agent_province}",
	city: "{#$info.agent_city}",
	dist: "{#$info.agent_district}",
	required: false
});
</script>
<script>
$('#zs_manage_id').change(function() {
	getAgent();
});

function getAgent() {
	var option = '<option value="0">==选择代理商==</option>';
	var zs_manage_id = $('#zs_manage_id').val();
	var url = '/Manage.php/Public/getAgent?agent_pid=' + zs_manage_id;
	$.get(url, function(data) {
		$('#agent_id').html(option + data);
	});
	$('#agent_id').val(0)
}
</script>
<script type="text/javascript">
$(function() {
	var loadi = null;
	var demo1 = $("#form_basic_validate").Validform({
		tiptype: 3,
		ajaxPost: true,
		postonce: true,
		tiptype: function(msg, o, cssctl) {
			if (!o.obj.is("form")) {
				var objtip = o.obj.siblings(".Validform_checktip");
				cssctl(objtip, o.type);
				objtip.text(msg);
			}
		},
		beforeSubmit: function(curform) {
			loadi = layer.load('表单正在处理中，请稍等 ...');
		},
		callback: function(data) {
			layer.close(loadi);
			if (data.status == 1) {
				layer.alert(data.msg, {icon: 1}, function() {
					parent.window.location.reload();
				});
			} else {
				layer.alert(data.msg, {icon: 0});
			}
		}
	});
})
</script>
</body>
</html>
